package com.zqt.zqt805.service.Impl;

import com.zqt.zqt805.domain.Category;
import com.zqt.zqt805.mapper.CategoryMapper;
import com.zqt.zqt805.service.CategoryService;
import com.zqt.zqt805.util.AjaxResult;
import com.zqt.zqt805.util.HttpStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {

    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public List<Category> getAllCategories() {
        List<Category> categoryList = categoryMapper.selectAllCategories();
        return categoryList;
    }

    @Override
    public void addCategory(Category category) {
        categoryMapper.insertCategory(category);
    }
}